import React, { Component } from 'react'
import { Spin } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
export default class Loading extends Component {

  render() {
    let { spinning } = this.props
    if (!spinning) {
      return ""
    }
    return (
      <div>
        <div style={{
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
          height: '100vh',
          position: 'fixed',
          width: '100vw',
          top: 0,
          zIndex: 10,
          background: 'rgba(0,0,0,0.2)'
        }}>

        </div>
        <div style={{
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
          height: '100vh',
          position: 'fixed',
          width: '100vw',
          top: 0,
          zIndex: 105,
        }}>
          <Spin size="large" indicator={<LoadingOutlined style={{ fontSize: 38 }} spin/>}/>
        </div>

      </div>
    )
  }
}
